<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/mainstyle.css"/>
<script src="./js/jquery-1.6.2.min.js"></script>
<title>用户套餐管理</title>
</head>
<script>


  	function delete_confirm()
	{
		if (confirm("确定要删除这个套餐吗?"))  {
			 return true;	
		}
		return false;	
	}
//页码导航 
function post_list(index,curpage,maxpage,agent_id)
{ 
     if (parseInt(index) <= parseInt(maxpage) && parseInt(index) > 0  && parseInt(curpage)!=parseInt(index) )
	 {
        document.form1.action = '?action=acct_user_ratepackage_list&curpage='+index+'&agent_id='+agent_id; 
	    document.form1.submit(); 
	    return true;
	 }
	 return false;
}


	function goback(old_curpage,agent_id)
	{
		var gotourl = 'user.php?action=list&curpage='+old_curpage+'&agent_id='+agent_id ; 
		//alert(gotourl);
	    document.form1.action = gotourl;
	
		document.form1.submit();
	}	

</script>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="97%" valign="bottom"><span class="table_caption">用户帐号消费套餐管理
                        &nbsp; &nbsp; <a href="#"  onClick="goback('<% $old_curpage %>','<% $agent_id %>')">返
                        回</a> </span></td>
                    </tr>
                  </table></td>
                <td><div align="right"></div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
        <form name="form2" method="post" action="?action=add_consumerpackage&id=<% $id %>&old_curpage=<% $curpage %>&old_agent_id=<% $agent_id %>">
          <tr>
            <td   height="24" colspan="10"   bgcolor="#FFFFFF" class="STYLE6"><span class="STYLE1">套餐：
              <select name="consumerpackage_id" class="STYLE1" id="consumerpackage_id"  >
                <%foreach from=$consumerpackages item=eachone key=keyname %>
                <option  value="<% $eachone.decode_id %>"  >
                <% $eachone.packagename %>
                </option>
                <%/foreach%>
              </select>
              <input type="submit"  class="STYLE1"   name="submitbtn" id="submitbtn"   value=" 添加 " />
              </span></td>
          </tr>
        </form>
        <form name="form1" method="post" action="?action=list">
        </form>
        <tr>
          <td width="2%"   height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">序号</div></td>
          <td width="6%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">用户帐号</div></td>
          <td width="8%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">名称</div></td>
          <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">拨打时长</div></td>
		   <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">类型</div></td>
		   <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">拨号前缀</div></td>
          <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">有效天数</div></td>
          <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">购买金额</div></td>
          <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">购买时间</div></td>
          <td width="4%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">删除</div></td>
        </tr>
        <% foreach from=$table_array item=eachone key=keyname %>
        <tr>
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.check_id %>
            </div></td>
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.acctname %>
            </div></td>
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.packagename %>
            </div></td>
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.timelong  %>
            </div></td>
			
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% if $eachone.timetype eq '1'  %>全天<%else%>闲时<%/if%>
            </div></td>			
			
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.prefix %>
            </div></td>
			
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.expireddays %>
            </div></td>
						
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.balance|string_format:"%.2f" %>
            </div></td>
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
              <% $eachone.createtime %>
            </div></td>
          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19"><a href="?action=del_consumerpackage&consumerpackage_id=<% $eachone.decode_id %>&id=<% $id %>&curpage=<% $curpage %>&old_curpage=<% $old_curpage %>&old_agent_id=<% $eachone.decode_agent_id %>"  onClick="return delete_confirm()" >删除</a></div></td>
        </tr>
        <% /foreach %>
      </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="33%"><div align="left"><span class="STYLE21">共
              <% $record_count %>
              条记录，当前第
              <% $curpage %>
              /
              <% $maxpage %>
              页，每页
              <% $pagelimtcount %>
              条记录</span></div></td>
          <td width="67%"><table width="180" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr>
                <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('1','<% $curpage %>','<% $maxpage %>','<% $agent_id %>')" >首页</a> </div></td>
                <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage-1 %>','<% $curpage %>','<% $maxpage %>','<% $agent_id %>')" >上一页</a></div></td>
                <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage+1 %>','<% $curpage %>','<% $maxpage %>','<% $agent_id %>')" >下一页</a></div></td>
                <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $maxpage  %>','<% $curpage %>','<% $maxpage %>','<% $agent_id %>')" >尾页</a></div></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
